<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2023/10/24
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"
         import="java.util.*" pageEncoding="UTF-8" %>
<html>
<head>
    <title>网上调查步骤之二</title>
</head>
<body>
<%
    String name = request.getParameter("name");
    out.print(name);
    //tomcat默认全部都是用ISO-8859-1编码,不管你页面用什么显示,
    // Tomcat最终还是会替你将所有字符转做ISO-8859-1.
    // 那么,当在另目标页面再用GBK翻译时就会将本来错的编码翻译成GBK的编码,这时的文字会乱码.
    name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
    String sex = request.getParameter("sex");
    if(sex !=null && sex.equals("male")){
        sex="先生";
    }else
        sex = "女士";
    session.putValue("namesex", name+sex);
%>
<%@include file="top.html"%>
<p>
    <!--显示受访者的姓名和性别-->
    <%=name%>
    <%=sex%>，你好，请继续完成调查
</p>
<P>
    你感兴趣的业余爱好有：
</P>
<form name="name1" method="post" action="shixun_result.jsp">
    <p>
        <input name="hobby0" type="checkbox" id="film" value="影视欣赏">
        影视欣赏
    </p>
    <p>
        <input name="hobby1" type="checkbox" id="book" value="阅读书籍">
        阅读书籍
    </p>
    <p>
        <input name="hobby2" type="checkbox" id="sports" value="体育运动">
        体育运动
    </p>
    <p>
        <input name="hobby3" type="checkbox" id="travel" value="户外旅游">
        户外旅游
    </p>
    <p>
        <input name="hobby4" type="checkbox" id="music" value="流行音乐">
        影视欣赏
    </p>
    <p>
        <input type="submit" name="Submit" value="下一步">
        <input type="reset" name="Reset" value="重置">

    </p>

</form>
</body>
</html>
